<template>
    <div class="box">
        <span v-if="label" class="label">{{ label }}</span>
        <div class="control">
            <slot></slot>
        </div>
    </div>
</template>

<script lang="ts">
import { Vue, Prop } from 'vue-property-decorator';

export default class CommonField extends Vue {
    @Prop({
      type: String,
      default: '标题',
    })
    label!: string;
}
</script>

<style lang='less' scoped>
.box {
    display: flex;
    align-items: center;
    margin-top: 10px;
    .label {
        padding-bottom: 2px;
        color: #898989;
    }
    .control {
        flex: 1;
        margin-left: 5px;
        &:first-child {
            width: 100%;
        }
    }
}
</style>
